package com.jacen.fzxs.web;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import com.jacen.fzxs.util.Constants;

public class PagerTag extends TagSupport {
	
	private String action;
	
	@Override
	public int doEndTag() throws JspException {
		Pager pager = (Pager) pageContext.getRequest().getAttribute(Constants.PAGER);
		if(action==null || "".equals(action))return SKIP_BODY;
		JspWriter out = pageContext.getOut();
		try {
			PagerCreator.pagerCreate(out,action,pager);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return EVAL_PAGE;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

}
